package cn.bearspark.sms.provider.rpc;

import cn.bearspark.common.dto.ResponseDTO;
import cn.bearspark.sms.provider.service.SmsService;
import cn.bearspark.sms.rpc.SmsRpc;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Component;

/**
 * @author f
 */
@Component
@DubboService
public class SmsRpcImpl implements SmsRpc {

    private final SmsService smsService;

    public SmsRpcImpl(SmsService smsService) {
        this.smsService = smsService;
    }

    @Override
    public ResponseDTO<Object> send(String phone) {
        return smsService.send(phone);
    }

    @Override
    public ResponseDTO<Object> verify(String phone, String code) {
        return smsService.verify(phone, code);
    }
}
